﻿Ext.setup({
   onReady: function() {        
        Ext.regModel('documentos', {
            fields: [                               
                {name: 'Codigo',type: 'string'},
                {name: 'Descripcion',   type: 'string'}
            ]
        });
        var documentosList = new Ext.DataView({
            store: new Ext.data.Store({
                model: 'documentos',
                proxy: {
                    type: 'ajax',
                    url : 'http://localhost:2460/Prueba1.aspx',
                    reader: {
                        type: 'json',
                        root: 'data'
                    }
                },
                autoLoad : true
            }),
            tpl: new Ext.XTemplate(
                '<tpl for=".">',
                    '<div class="item">',
                        '"{Codigo}"',
                        '"{Descripcion}"',
                    '</div>',
                '</tpl>'
            ),
            itemSelector: "div.item",
            fullscreen: true
        });
   }
});